package com.hbnu.system.controller;

import com.hbnu.system.core.base.Rest;
import com.hbnu.system.model.entity.Report_Qualification;
import com.hbnu.system.service.IReportQualificationService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/reportqulification")
@Api(tags = "报告量化模块")
public class ReportQualificationController {
    @Autowired
    private IReportQualificationService iReportQualificationService;

    @ApiOperation("报告量化添加")
    @PostMapping("/addReportQulification")
    public Rest<Boolean> addReportQulification(@RequestBody Report_Qualification report_qualification){
        boolean add = iReportQualificationService.addReport_Qualification(report_qualification);
        return add ? Rest.success() : Rest.failed();
    }

    @ApiOperation("报告量化删除")
    @GetMapping("/deleteReportQulification")
    public Rest<Boolean> deleteReportQulification(String ID){
        boolean delete = iReportQualificationService.deleteReport_Qualification(ID);
        return delete ? Rest.success() : Rest.failed();
    }


    @ApiOperation("报告量化查看")
    @GetMapping("/getReportQulification")
    public Rest<List<Report_Qualification>> getReportQulification(String ReportID){
        List<Report_Qualification> oneReport_qualification = iReportQualificationService.getOneReport_Qualification(ReportID);
        return Rest.success(oneReport_qualification);
    }
}
